package com.jumei.flume.source.kafka.partition;

import kafka.producer.Partitioner;

/**
 * @author admin
 *
 */
public class SimplePartitioner implements Partitioner {

	public SimplePartitioner (kafka.utils.VerifiableProperties props) {
		
		
	}
	
	@Override
	public int partition(Object key, int numPartitions) {
		int partition = 0;
		String k = (String)key;
		partition = Math.abs(k.hashCode()) % numPartitions;
		return partition;
	}

}
